package com.zff.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * TODO
 * @version 1.0
 * @author Zff
 * @date 2020/8/17 14:39
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("http://xspx.zhyww.cn") //xspx.zhyww.cn
                .allowedMethods("*")
                .allowedHeaders("*");
    }
}
